<template>
  <div class="child">
    <h2>child ---{{ props.msg }}</h2>
    <input
      type="text"
      v-model="son"
    />
  </div>
</template>
<script setup>
import { ref, defineProps, defineEmits, watch } from 'vue'
const son = ref('子组件的输入')
const props = defineProps(['msg'])
const emits = defineEmits(['update:msg'])
watch(son, (newVal) => {
  emits('update:msg', newVal)
})
</script>
<style
  lang="scss"
  scoped
></style>
